.\"	$OpenBSD: PKCS8_PRIV_KEY_INFO_new.3,v 1.1 2016/12/22 12:10:06 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: December 22 2016 $
.Dt PKCS8_PRIV_KEY_INFO_NEW 3
.Os
.Sh NAME
.Nm PKCS8_PRIV_KEY_INFO_new ,
.Nm PKCS8_PRIV_KEY_INFO_free
.Nd PKCS#8 private key information
.Sh SYNOPSIS
.In openssl/x509.h
.Ft PKCS8_PRIV_KEY_INFO *
.Fn PKCS8_PRIV_KEY_INFO_new void
.Ft void
.Fn PKCS8_PRIV_KEY_INFO_free "PKCS8_PRIV_KEY_INFO *key"
.Sh DESCRIPTION
.Fn PKCS8_PRIV_KEY_INFO_new
allocates and initializes an empty
.Vt PKCS8_PRIV_KEY_INFO
object, representing an ASN.1
.Vt PrivateKeyInfo
structure defined in RFC 5208 section 5.
It can hold a private key together with information about the
algorithm to be used with it and optional attributes.
.Pp
.Fn PKCS8_PRIV_KEY_INFO_free
frees
.Fa key .
.Sh RETURN VALUES
.Fn PKCS8_PRIV_KEY_INFO_new
returns the new
.Vt PKCS8_PRIV_KEY_INFO
object or
.Dv NULL
if an error occurs.
.Sh SEE ALSO
.Xr d2i_PKCS8PrivateKey_bio 3 ,
.Xr PEM_read_PKCS8_PRIV_KEY_INFO 3 ,
.Xr PKCS12_parse 3 ,
.Xr X509_ATTRIBUTE_new 3
.Sh STANDARDS
RFC 5208: PKCS#8: Private-Key Information Syntax Specification
